package org.geektimes.projects.user.validation.annotation;

import org.geektimes.projects.user.validation.impl.PhoneNumberConstraintValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;
import java.lang.annotation.ElementType.*;

import static java.lang.annotation.ElementType.*;

/**
 * @author : zghuang
 * @date : 2021/3/15 17:05
 */
@Documented
@Constraint(validatedBy = PhoneNumberConstraintValidator.class)
@Target({METHOD,FIELD,PARAMETER,CONSTRUCTOR})
@Retention(RetentionPolicy.RUNTIME)
public @interface PhoneNumber {

    String message() default "{com.geektimes.projects.user.validator.annotation.PhoneNumber.message}";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}
